package com.jacky.iot.service;

import com.jacky.iot.commons.TaskType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

@Data
@Accessors(chain = true)
public class TaskWrapper {
    private String taskId;
    private TaskType taskType;
    private int taskDelayMs = 0;
    private int interval = 10;
    private TimeUnit intervalTU = TimeUnit.SECONDS;
    private Runnable task;
    private Future<?> future;

    public TaskWrapper() {
    }

    public TaskWrapper(String taskId, Runnable task, TaskType taskType, int taskDelayMs, int interval, TimeUnit intervalTU) {
        this.taskId = taskId;
        this.task = task;
        this.taskType = taskType;
        this.taskDelayMs = taskDelayMs;
        this.interval = interval;
        this.intervalTU = intervalTU;
    }


}
